﻿/*=======================================================================
	TASK 2:                                      {Conditional Statements}
	Write a program that shows the sign (+ or -) of the product of three 
    real numbers without calculating it. Use a sequence of if statements. 
=======================================================================*/

using System;

class ProductOfRealNumbersWithoutCalculatig
{
    static void Main()
    {
        float firstNum, secondNum, thirdNum;
        int count = 0;

        firstNum = -1.5f;
        secondNum = -1.5f;
        thirdNum = -1.5f;

        //===============FIRST SOLUTION===================//

        if (firstNum == 0 || secondNum == 0 || thirdNum == 0)
        {
            Console.WriteLine("product=0 and product's sign is:\"+\"\n");
        }
        else
        {
            if (firstNum < 0)
            {
                count++;
            }
            if (secondNum < 0)
            {
                count++;
            }
            if (thirdNum < 0)
            {
                count++;
            }

            if (count == 1 || count == 3)
            {
                Console.WriteLine("product's sign is:\"-\"\n");
            }
            else
            {
                Console.WriteLine("product's sign is:\"+\"\n");
            }
        }

        //===============SECOND SOLUTION===================//

        //bool ifOneNumberIsNegative = (firstNum < 0 || secondNum < 0 || thirdNum < 0) && ((secondNum > 0 && thirdNum > 0) || (firstNum > 0 && thirdNum > 0) || (firstNum > 0 && secondNum > 0));
        //bool ifThreeNumbersAreNegative = firstNum < 0 && secondNum < 0 && thirdNum < 0;

        //if (ifOneNumberIsNegative || ifThreeNumbersAreNegative)
        //{
        //    Console.WriteLine("product's sign is:\"-\"\n");
        //}

        //else if(firstNum==0||secondNum==0||thirdNum==0)
        //{
        //    Console.WriteLine("product=0 and product's sign is:\"+\"\n");
        //}
        //else
        //{
        //    Console.WriteLine("The three numbers is positive => product's sign is:\"+\"\n");
        //}
        //Console.WriteLine("product with calculating:{0}\n", firstNum * secondNum * thirdNum);


        //===============THIRD SOLUTION===================//
                /*using System;

        class ExchangeGreaterOneWithsecondVariable
        {
            static void Main()
            {
                Console.Write("Въведи първото число: ");
                decimal a = Convert.ToDecimal(Console.ReadLine());
                Console.Write("Въведи второто число: ");
                decimal b = Convert.ToDecimal(Console.ReadLine());
                Console.Write("Въведи третото число: ");
                decimal c = Convert.ToDecimal(Console.ReadLine());

                bool aSing = a > 0;
                bool bSing = b > 0;
                bool cSing = c > 0;

                if (aSing ^ bSing ^ cSing)
                {
                    Console.WriteLine("Знакът след умножение ще е +");
                }
                else
                {
                    Console.WriteLine("Знакът след умножение ще е -");
                }
            }
        }*/
    }
}

